﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CriarEmentaDia.aspx.cs" Inherits="ProjectoPV_ESW.Account.Ementa.CriarEmentaDia"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div align="center">
    <h1 align="center">Criar Ementa</h1>
    <br />
    Sopa:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox1" runat="server" Width="188px" Height="30px"></asp:TextBox>
    <br />
    <br />
    Sobremesa:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox2" runat="server" Width="186px" Height="30px"></asp:TextBox>
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <br />
    <br />
    <asp:Button ID="ButtonOKEmentaDia0" runat="server" BackColor="#CCCCFF" 
        Font-Bold="True" ForeColor="Gray" Height="30px" 
        Text="Adicionar Ementa Base" Width="300px" 
        onclick="ButtonOKEmentaDia_Click" BorderColor="#CC99FF" BorderStyle="Double" 
            BorderWidth="3px" Font-Names="Calibri" Font-Size="Medium" />
        <br />
        <br />
        _____________________________________________________________________________________<br />
        <br />
    <h3>Ementas base</h3>
        <br />
        <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" DataKeyNames="EmentaId" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" BackColor="White" 
            BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            GridLines="Horizontal" Width="400px">
        <AlternatingRowStyle BackColor="#F7F7F7" />
        <Columns>
            <asp:CommandField ShowEditButton="True" ShowSelectButton="True" />
            <asp:BoundField DataField="EmentaId" HeaderText="EmentaId" 
                SortExpression="EmentaId" InsertVisible="False" ReadOnly="True" />
            <asp:BoundField DataField="Sopa" HeaderText="Sopa" 
                SortExpression="Sopa" />
            <asp:BoundField DataField="Sobremesa" HeaderText="Sobremesa" 
                SortExpression="Sobremesa" />
        </Columns>
        <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
        <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
        <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        <SortedAscendingCellStyle BackColor="#F4F4FD" />
        <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
        <SortedDescendingCellStyle BackColor="#D8D8F0" />
        <SortedDescendingHeaderStyle BackColor="#3E3277" />
    </asp:GridView>
        <br />
        <asp:Label ID="LabelInfoGrid" runat="server" ForeColor="#00CC00"></asp:Label>
        <br />
        <br />
        Detalhes de Ementa seleccionada:<br />
        <asp:TextBox ID="TextBox3" runat="server" Height="150px" ReadOnly="True" 
            Rows="9" TextMode="MultiLine" Width="300px"></asp:TextBox>
        <br />
        <br />
    <br />
    &nbsp;<asp:Button ID="Button1" runat="server" BackColor="#CCCCFF" Font-Bold="True" 
            ForeColor="Gray" Height="30px" onclick="Button1_Click" 
            Text="Adicionar/Editar Pratos a Ementa" Visible="False" Width="300px" 
            BorderColor="#CC99FF" BorderStyle="Double" BorderWidth="3px" 
            Font-Names="Calibri" Font-Size="Medium" />
        <br />
    &nbsp;&nbsp; &nbsp;&nbsp;
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:JardimEntitiesString %>" 
        ProviderName="<%$ ConnectionStrings:JardimEntitiesString.ProviderName %>" 
        SelectCommand="SELECT * FROM [Ementa]" 
        DeleteCommand="DELETE FROM [Ementa] WHERE [EmentaId] = ?" 
        InsertCommand="INSERT INTO [Ementa] ([Sopa], [Sobremesa]) VALUES (?, ?)" 
        UpdateCommand="UPDATE [Ementa] SET [Sopa] = ?, [Sobremesa] = ? WHERE [EmentaId] = ?">
        <DeleteParameters>
            <asp:Parameter Name="EmentaId" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Sopa" Type="String" />
            <asp:Parameter Name="Sobremesa" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Sopa" Type="String" />
            <asp:Parameter Name="Sobremesa" Type="String" />
            <asp:Parameter Name="EmentaId" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <p><asp:Label ID="LabelErr" runat="server"></asp:Label></p>
    </div>
</asp:Content>
